import static org.junit.Assert.*;
import java.util.Arrays;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;


@RunWith(Parameterized.class)
public class TriangleTest {
	private int a, b, c;
	private String type;

	@Before
	public void setUp() throws Exception {
	}

	public TriangleTest(int a, int b, int c, String type) {
		this.a = a;
		this.b = b;
		this.c = c;
		this.type = type;
	}

	@Parameters
	public static Collection<Object[]> getData() {
		return Arrays.asList(
				new Object[][] { 
					{ 1, 2, 3, "非三角形" }, 
					{ 50, 50, 50, "等边三角形" }, 
					{ 0, 1, 2, "非三角形" }, 
					{ 4, 3, 5, "不等边三角形" },
					{ 3, 3, 4, "等腰三角形" }, 
					{ 4, 4, 6, "等腰三角形" }, 
					{ 1, 0, 0, "非三角形" }, 
					{ 9, 9, 9, "等边三角形" },
		});
	}

	@Test
	public void testClassify() {
		assertEquals(this.type, Triangle.classify(a, b, c));
	}

}
